#include<iostream>
#include<unordered_map>
using namespace std;
unordered_map<int, int> mp;
int main()
{
    int n;
    cin >> n;
    while (n--) {
        int x;
        cin >> x;
        mp[x]++;
    }
    int sum = 0;
    int sump = 0;
    for (auto& e : mp) {
        if (e.second > 2) {
            sum += (e.second - 2);
        }
        else if (e.second == 1) {
            sump++;
        }
    }
    cout << sum + max(0, (sump - sum)) / 2 << endl;
    return 0;
}